package org.xutils;

import org.xutils.view.ViewInjectorImpl;

/**
 * Created by ZZH on 4/20/21.
 *
 * @Date: 4/20/21
 * @Email: zzh_hz@126.com
 * @QQ: 1299234582
 * @Author: zzh
 * @Description:
 */
public class xView {
    private static xView mInstance;

    private xView() {
    }

    public static xView getInstance() {
        if (mInstance == null) {
            synchronized (xView.class) {
                if (mInstance == null) {
                    mInstance = new xView();
                }
            }
        }
        return mInstance;
    }

    private static ViewInjector viewInjector;

    public static ViewInjector view() {
        if (xView.viewInjector == null) {
            ViewInjectorImpl.registerInstance();
        }
        return xView.viewInjector;
    }

    public static void setViewInjector(ViewInjectorImpl viewInjector) {
        xView.viewInjector = viewInjector;
    }
}
